#include "mainwindow.h"
#include "ui_mainwindow.h"

//#include "globalhelper.h"
#include <QFontDatabase>

//#include "MediaPlayer.h"
#include "ctrlbar.h"

MainWindow::MainWindow(QWidget *parent) :
    BasicWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    setAttribute(Qt::WA_DeleteOnClose);
    initTitleBar();
    loadStyleSheet("MainWindow");
//    Init();
}

MainWindow::~MainWindow()
{
    delete ui;
}




bool MainWindow::CtrlBar_ConnectSignalSlots()
{
#ifdef  Debug_Falg
    qDebug() << "The name is : <" << __func__ << "> The file is :<" << __FILE__ << ">Thread is <" << QThread::currentThreadId();
#endif


    return true;
}

bool MainWindow::MediaPlayer_ConnectSignalSlots()
{
#ifdef  Debug_Falg
    qDebug() << "The name is : <" << __func__ << "> The file is :<" << __FILE__ << ">Thread is <" << QThread::currentThreadId();
#endif

    return true;
}

bool MainWindow::ConnectSignalSlots()
{
#ifdef  Debug_Falg
    qDebug() << "The name is : <" << __func__ << "> The file is :<" << __FILE__ << ">Thread is <" << QThread::currentThreadId();
#endif

    return true;
}


void MainWindow::on_pushButton_video_clicked()
{
#ifdef  Debug_Falg
    qDebug() << "The name is : <" << __func__ << "> The file is :<" << __FILE__ << ">Thread is <" << QThread::currentThreadId();
#endif
    ui->stackedWidget->setCurrentIndex(0);
}

void MainWindow::on_pushButton_book_clicked()
{
#ifdef  Debug_Falg
    qDebug() << "The name is : <" << __func__ << "> The file is :<" << __FILE__ << ">Thread is <" << QThread::currentThreadId();
#endif
    ui->stackedWidget->setCurrentIndex(1);
}

void MainWindow::on_pushButton_my_clicked()
{
#ifdef  Debug_Falg
    qDebug() << "The name is : <" << __func__ << "> The file is :<" << __FILE__ << ">Thread is <" << QThread::currentThreadId();
#endif
    ui->stackedWidget->setCurrentIndex(2);
}

//int MainWindow::OutputVideo(const Frame *video_frame)
//{
//#ifdef  Debug_Falg
//    qDebug() << "The name is : <" << __func__ << "> The file is :<" << __FILE__ << ">Thread is <" << QThread::currentThreadId();
//#endif
//    // 调用显示窗口的 draw 方法，将视频帧绘制到窗口上
//    // 传递视频帧指针，同时指定两个布尔参数为 false
//    return ui->ShowWid->draw(video_frame, false, false);
//}






